/**
 * @filename:FilesController 2022-04-24 10:49:28
 * @project com/lwl/blue  V1.0
 * Copyright(c) 2020 <a href=mailto:lanwenliang@yidianlife.com>蓝文良</a> Co. Ltd.
 * All right reserved.
 */
package com.lwl.blue.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lwl.blue.commont.base.JsonResult;
import com.lwl.blue.commont.base.PageParam;
import com.lwl.blue.commont.base.PageResult;
import com.lwl.blue.entity.Files;
import com.lwl.blue.service.FilesService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>自定义方法写在这里</p>
 *
 * <p>说明： 上传文件记录表API接口层</P>
 *
 * @version: V1.0
 * @author: <a href=mailto:lanwenliang@yidianlife.com>蓝文良</a>
 */
@Api(tags = "上传文件记录表")
@RestController
@RequestMapping("/files")
@Slf4j
public class FilesController {
    @Autowired
    FilesService filesService;

    @PostMapping("/pages")
    public PageResult<Files> getPages(@RequestBody PageParam<Files> pageParam) {
        JsonResult<Page<Files>> pages = filesService.pages(pageParam);
        PageResult<Files> re = new PageResult<>();
        re.success(pages.getData().getTotal(), pages.getData().getRecords());
        return re;
    }

}
